# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo9.01
# Description:
# Author:       $赵怡蕾
# Date:         2019/3/4
#-------------------------------------------------------------------------------

# 定义曲速引擎过载的异常类
class WarpdrivOverloadException(Exception):
    pass

# 当前的曲速值
warpSpeed = 12
# 当曲速为10或以上值时认为是曲速引擎过载，应该抛出异常
if warpSpeed >= 10:
    # 抛出自定义异常
    raise WarpdrivOverloadException("曲速引擎已经过载，请停止或弹出曲速核心，否则飞船将会爆炸")